<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .main {
        width: 500px;
        height: 300px;
      }
    </style>
  </head>
  <body>
    <div class="main"></div>
    <script src="../assets/lib/echarts/echarts.min.js"></script>
    <script>
      const myChart = echarts.init(document.querySelector(".main"));
      const option = {
        color: ["red", "blue"],
        title: {
          text: "薪资 salary",
        },
        legend: {},
        xAxis: {
          type: "category",
          data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
        },
        yAxis: {
          type: "value",
        },
        tooltip: {
        trigger:'axis'
    },
        series: [
          {
            name: "期望薪资",
            data: [820, 932, 901, 934, 1290, 1330, 1320],
            type: "line",
            symbol: "circle",
            smooth: true,
          },
          {
            name: "实际薪资",
            data: [654, 543, 765, 544, 321, 343, 845],
            type: "line",
            symbol: "circle",
            smooth: true,
          },
        ],
        dataZoom: [
          {
            // 滑块开始的位置
            start: 0,
            // 滑块结束位置
            end: 30,
          },
        ],
      };
      myChart.setOption(option);
    </script>
  </body>
</html>
